package com.hangar.eforms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hangar.eforms.entity.FormsDataChangeEntity;
import com.hangar.eforms.vo.FormsDataChangeVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface FormsDataChangeMapper extends BaseMapper<FormsDataChangeEntity> {
    int deleteById(Integer id);

    int insert(FormsDataChangeEntity record);

    FormsDataChangeEntity loadById(Integer id);

    /**
     * 根据表单数据ID查询表单所有杠改记录
     * @param formDataId 表单数据ID
     * @return 按杠改时间倒序返回查询结果
     */
    List<FormsDataChangeVo> allByFormDataId(Integer formDataId);

    /**
     * 批量插入表单杠改数据
     * @param changeList 杠改数据
     */
    void batchInsert(@Param("changeList") List<FormsDataChangeEntity> changeList);

    int update(FormsDataChangeEntity record);
}